package cn.edu.ldu.protocol;

import cn.edu.ldu.controller.FriendController;
import cn.edu.ldu.entity.FriendsEntity;
import cn.edu.ldu.util.L;
import cn.edu.ldu.views.controller.MainUIController;
import com.alibaba.fastjson.JSONObject;

public class Logout {
    public Logout(Protocol protocol){

        FriendsEntity friends = JSONObject.parseObject(protocol.getData(),FriendsEntity.class);
        L.OK(friends,FriendsEntity.class);

        //去掉离线好友
        FriendController.deleteOnline(friends);

        MainUIController.getMainUI().deleteFriendList(friends.getUserAccountEntity().getNickName());
    }
}
